package com.itheima.homework;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @Author 王加鑫
 * @Date 2021/5/19 19:58
 * @Version 1.0
 * 1、【编号：1708】请使用字节流，把“E:\itcast\窗里窗外.txt”文件，复制到模块目录下的“窗里窗外.txt”。
 */
public class Demo01 {
    public static void main(String[] args) throws IOException {
        FileInputStream fileInputStream = new FileInputStream("E:/itcast/窗里窗外.txt");
        FileOutputStream outputStream = new FileOutputStream("day12_file&字节流/窗里窗外.txt");

        byte[] bytes = new byte[1024];
        int len;
        while ((len = fileInputStream.read(bytes)) != -1){
            outputStream.write(bytes,0,len);
        }
        fileInputStream.close();
        outputStream.close();
    }
}
